package com.aabte.testng.groups;

import org.testng.annotations.AfterGroups;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;

/**
 * 按方法分组
 */
public class GroupsOnMethod {

    @BeforeGroups("Server")
    public void beforeGroupsOnServer(){
        System.out.println("Server组BeforeGroups");
    }

    @Test(groups = "Server")
    public void test1(){
        System.out.println("Server组测试1");
    }

    @Test(groups = "Server")
    public void test2(){
        System.out.println("Server组测试2");
    }

    @AfterGroups("Server")
    public void afterGroupsOnServer(){
        System.out.println("Server组AfterGroups");
    }

    @BeforeGroups("Client")
    public void beforeGroupsOnClient(){
        System.out.println("Client组BeforeGroups");
    }

    @Test(groups = "Client")
    public void test3(){
        System.out.println("Client组测试1");
    }

    @Test(groups = "Client")
    public void test4(){
        System.out.println("Client组测试2");
    }

    @AfterGroups("Client")
    public void afterGroupsOnClient(){
        System.out.println("Client组AfterGroups");
    }

}
